/*
 * 牛牛协议
 */
let proto = module.exports;

proto.GAME_ROB_BANK_NOTIFY = 301; /* 抢庄通知 */
proto.GAME_ROB_BANK_PUSH = 401; /* 抢庄推送 */

proto.GAME_BANKER_PUSH = 402; /* 庄家推送 */

proto.GAME_POUR_SCORE_NOTIFY = 303; /* 下分通知 */
proto.GAME_POUR_SCORE_PUSH = 403; /* 下分推送 */


proto.GAME_SHOW_CARDS_NOTIFY = 304; /* 亮牌通知 */
proto.GAME_SHOW_CARDS_PUSH = 404; /* 亮牌推送 */


proto.GAME_STATUS_PUSH = 405; /* 游戏状态推送 */
proto.GAME_RESULT_PUSH = 406; /* 游戏结果推送 */
proto.GAME_SEND_CARDS_PUSH = 407; /* 发牌推送 */
proto.GAME_BUREAU_PUSH = 408; /* 局数推送 */
proto.GAME_END_PUSH = 409; /* 游戏结束推送 */

proto.GAME_CHAT_NOTIFY = 310; /* 游戏聊天 */
proto.GAME_CHAT_PUSH = 410;

proto.GAME_TRUST_NOTIFY = 311; /* 托管 */
proto.GAME_TRUST_PUSH = 411; /* 托管 */

proto.GAME_REVIEW_NOTIFY = 312; /* 牌面回顾 */
proto.GAME_REVIEW_PUSH = 412;

proto.GAME_TUI_ARR_PUSH = 413; /* 推注 推送 */

proto.GAME_RUFFIAN_RECORD_PUSH = 414; //癞子消息推送

proto.GAME_TRADERUFFIAN_PUSH = 415; //发牌癞子推送

//----------------------------调试功能------------------------------------
proto.GAME_LOOK_CARDS_NOTIFY = 316; /* 看牌 */
proto.GAME_LOOK_CARDS_PUSH = 416; /* 看牌结果 */

proto.GAME_SUBSTRATUM_TRADE_CARDS_NOTIFY = 317; /* 下局换牌 */
proto.GAME_SUBSTRATUM_TRADE_CARDS_PUSH = 417; /* 下局换牌结果 */

proto.GAME_INQTIRE_ARRCARDS_NOTIFY = 318; /* 查询牌库 */
proto.GAME_INQTIRE_ARRCARDS_PUSH = 418; /*查询牌库结果 */

proto.GAME_END_POUR_SCORE_PUSH = 419; /* 下分结束推送 */

proto.GAME_END_TYPE_CARDS_PUSH = 420; /* 结算牛牛牌型推送 */

proto.gameStatus = {
	NONE: 0,
	/* 等待操作 */
	ROB_BANK: 1,
	/* 抢庄中 */
	POUR_SCORE: 2,
	/* 下分中 */
	SEND_CARDS: 3,
	/* 发牌中 */
	SHOW_CARDS: 4,
	/* 选择亮牌 */
	RESULT: 5,
	/* 显示结果 */
};

proto.gameStatusTm = {
	NONE: 0,
	/* 等待操作 */
	ROB_BANK: 10,
	/* 抢庄中 */
	POUR_SCORE: 15,
	/* 下分中 */
	SEND_CARDS: 1,
	/* 发牌中 */
	SHOW_CARDS: 10,
	/* 选择亮牌 */
	RESULT: 15,
	/* 显示结果 */
};

proto.gameStatusTm_jiaSuMoShi = {
	NONE: 0,
	/* 等待操作 */
	ROB_BANK: 4,
	/* 抢庄中 */
	POUR_SCORE: 4,
	/* 下分中 */
	SEND_CARDS: 1,
	/* 发牌中 */
	SHOW_CARDS: 4,
	/* 选择亮牌 */
	RESULT: 1,
	/* 显示结果 */
};

proto.payType = {
	/* 支付方式 */
	AAZHIFU: 1,
	YINGJIAZHIFU: 2,
	WOZHIFU: 3,
};

proto.gameType = {
	NIUNIU: 1,
	/* 牛牛上庄 */
	ZHIYOUQZ: 2,
	/* 自由抢庄 */
	LUNZHUANG: 3,
	/* 轮庄 */
	TONGBI: 4,
	/* 通比 */
	FANGZHU: 5,
	/* 房主坐庄 */
	MINGPAIQZ: 6,
	/* 明牌抢庄 */
};

proto.cardsType = {
	MEINIU: 1,
	/* 没牛 */
	YOUNIU: 2,
	/* 有牛 */
	NIUNIU: 3,
	/* 牛牛 */
	SHUNZINIU: 4,
	/* 顺子牛 */
	YINNIU: 5,
	/* 银牛 */
	TONGHUANIU: 6,
	/* 同花牛 */
	WUHUANIU: 7,
	/* 五花牛 */
	HULUNIU: 8,
	/* 葫芦牛 */
	WUXIAONIU: 9,
	/* 五小牛 */
	ZHADANNIU: 10,
	/* 炸弹牛 */
	YITIAOLONG: 11,
	/* 一条龙 */
	TONGHUASHUN: 12,
	/* 同花顺 */
};

proto.sendCardType = {
	QUANAN: 1,
	/* 全暗 */
	MING3AN2: 2,
	/* 明3暗2 */
	MING4AN1: 3,
	/* 明4暗1 */
	MINGPAI: 4,
	/* 明5 */
};

proto.scaleType = {
	/* 翻倍规则 */
	BIG: 1,
	/* 牛牛(x4)牛九(x3)牛八(x2)牛七(x2) */
	LITTLE: 2,
	/* 牛牛(x3)牛九(x2)牛八(x2) */
	DIANZI: 3,
	/* 点子牛 */
};
//------------------------新增癞子玩法---------------------------------
proto.ruffianType = {
	WU: 1,
	/* 无 */
	WANGLAI: 2,
	/* 王癞 */
	SHUIJILAI: 3,
	/* 随机赖 */
};

proto.gameRobBankNotify = function (robScale) {
	return {
		type: this.GAME_ROB_BANK_NOTIFY,
		data: {
			robScale: robScale,
		},
	};
};

proto.gameRobBankPush = function (chairID, robScale) {
	return {
		type: this.GAME_ROB_BANK_PUSH,
		data: {
			chairID: chairID,
			robScale: robScale,
		},
	};
};

proto.gameBankerPush = function (bankerChairID, robScale, robChairIDs) {
	return {
		type: this.GAME_BANKER_PUSH,
		data: {
			bankerChairID: bankerChairID,
			robScale: robScale,
			robChairIDs: robChairIDs,
		},
	};
};

proto.gamePourScoreNotify = function (score) {
	return {
		type: this.GAME_POUR_SCORE_NOTIFY,
		data: {
			score: score,
		},
	};
};

proto.gamePourScorePush = function (chairID, score) {
	return {
		type: this.GAME_POUR_SCORE_PUSH,
		data: {
			chairID: chairID,
			score: score,
		},
	};
};

proto.gameShowCardsNotify = function (cuopai) {
	return {
		type: this.GAME_SHOW_CARDS_NOTIFY,
		data: {
			cuopai: cuopai,
		},
	};
};

proto.gameShowCardsPush = function (chairID, cards, ends, cuopai) {
	return {
		type: this.GAME_SHOW_CARDS_PUSH,
		data: {
			chairID: chairID,
			cards: cards,
			ends: ends,
			cuopai: cuopai,
		},
	};
};

proto.gameruffianRecordPush = function (chairID, cards, record, endCards, cuopai) {
	return {
		type: this.GAME_RUFFIAN_RECORD_PUSH,
		data: {
			chairID: chairID,
			cards: cards,
			record: record,
			endCards: endCards,
			cuopai: cuopai,
		},
	};
};

proto.gameTraderuffianPush = function (cards) {
	return {
		type: this.GAME_TRADERUFFIAN_PUSH,
		data: {
			cards: cards,
		},
	};
};


proto.gameStatusPush = function (gameStatus, tick, userStatus = []) {
	return {
		type: this.GAME_STATUS_PUSH,
		data: {
			gameStatus: gameStatus,
			tick: tick,
			userStatus: userStatus,
		},
	};
};

proto.gameResultPush = function (result) {
	return {
		type: this.GAME_RESULT_PUSH,
		data: {
			result: result,
		},
	};
};

proto.gameSendCardPush = function (handCards, endCards, ruffianRecord) {
	return {
		type: this.GAME_SEND_CARDS_PUSH,
		data: {
			handCards: handCards,
			endCards: endCards,
			ruffianRecord: ruffianRecord,
		},
	};
};

proto.gameBureauPush = function (curBureau) {
	return {
		type: this.GAME_BUREAU_PUSH,
		data: {
			curBureau: curBureau,
		},
	};
};

proto.gameEndPush = function (result, winMost, loseMost, creater, plusInfo, hongBaoList) {
	return {
		type: this.GAME_END_PUSH,
		data: {
			result: result,
			winMost: winMost,
			loseMost: loseMost,
			creater: creater,
			plusInfo: plusInfo,
			hongBaoList: hongBaoList,
		},
	};
};

proto.gameChatNotify = function (type, msg, recipientID) {
	return {
		type: this.GAME_CHAT_NOTIFY,
		data: {
			type: type,
			msg: msg,
			recipientID: recipientID,
		},
	};
};

proto.gameChatPush = function (chairID, type, msg, recipientID) {
	return {
		type: this.GAME_CHAT_PUSH,
		data: {
			chairID: chairID,
			type: type,
			msg: msg,
			recipientID: recipientID,
		},
	};
};

proto.gameTrushNotify = function (trust) {
	return {
		type: this.GAME_TRUST_NOTIFY,
		data: {
			trust: trust,
		},
	};
};

proto.gameTrushPush = function (chairID, trust) {
	return {
		type: this.GAME_TRUST_PUSH,
		data: {
			chairID: chairID,
			trust: trust,
		},
	};
};

proto.gameReviewNotify = function () {
	return {
		type: this.GAME_REVIEW_NOTIFY,
		data: {},
	};
};

proto.gameReviewPush = function (list) {
	return {
		type: this.GAME_REVIEW_PUSH,
		data: {
			list: list,
		},
	};
};

proto.gameTuiArrPush = function (tuiArr) {
	return {
		type: this.GAME_TUI_ARR_PUSH,
		data: {
			tuiArr: tuiArr,
		},
	};
};

proto.gameLookCardsNotify = function (chairID) {
	return {
		type: this.GAME_LOOK_CARDS_NOTIFY,
		data: {
			chairID,
		},
	};
};

proto.gameLookCardsPush = function (userArray) {
	return {
		type: this.GAME_LOOK_CARDS_PUSH,
		data: {
			userArray: userArray,
		},
	};
};

proto.gameSubstratumTradeCardsNotify = function (chairID, winrate) {
	return {
		type: this.GAME_SUBSTRATUM_TRADE_CARDS_NOTIFY,
		data: {
			chairID,
			winrate: winrate,
		},
	};
};

proto.gameSubstratumTradeCardsPush = function (success, trust, SubstratumTradeCards) {
	return {
		type: this.GAME_SUBSTRATUM_TRADE_CARDS_PUSH,
		data: {
			success: success,
			trust: trust,
			SubstratumTradeCards: SubstratumTradeCards,
		},
	};
};

proto.gameireArrcardsPush = function (chairID, cardDataArr, SubstratumTradeCards) {
	return {
		type: this.GAME_INQTIRE_ARRCARDS_PUSH,
		data: {
			chairID,
			cardDataArr: cardDataArr,
			SubstratumTradeCards: SubstratumTradeCards,
		},
	};
};

proto.gameendPourScorePush = function () {
	return {
		type: this.GAME_END_POUR_SCORE_PUSH,
		data: {},
	};
};


proto.gameendTypeCardsPush = function (chairID, endTypeCards) {
	return {
		type: this.GAME_END_TYPE_CARDS_PUSH,
		data: {
			chairID: chairID,
			endTypeCards: endTypeCards,
		},
	};
};